package model;

import java.awt.Image;

public class Game {
	private int id;
	private String player1;
	private String player2;
	private boolean from1to2;
	
	private Image image;
	private String answer;
	
	public Game(String player1, String player2) {
		this.player1 = player1;
		this.player2 = player2;
		from1to2 = false;
	}
	
	public void add(Image image, String answer) {
		this.image = image;
		this.answer = answer;
		from1to2 = !from1to2;
	}
	
	public String getAnswer() {
		return answer;
	}
	
	public boolean verify(String answer) {
		return this.answer.equals(answer);
	}
	
	public Image getImage() {
		return image;
	}
	
	public String getFromPlayer() {
		if (from1to2)
			return player1;
		else return player2;
	}
	
	public String getToPlayer() {
		if (from1to2)
			return player2;
		else return player1;
	}
}
